<template>
	<view>
		<view class="cu-list menu sm-border">
			<view class="cu-item" v-for="item in shopList">
				<view class="content padding-tb-sm">
					<view>
						<text class="cuIcon-title text-blue margin-right-xs"></text>{{item.name}}</view>
					<view class="text-gray text-sm" v-if="item.address">
						<text class="cuIcon-infofill margin-right-xs"></text> {{item.address}}</view>
				<view class="text-gray text-sm" v-if="item.hotline">
						<text class="cuIcon-phone margin-right-xs"></text> {{item.hotline}}</view>
				
				</view>
				<view class="action">
					<view class="cu-tag round bg-blue light" @click="contactUs(item.hotline)">联系我们</view>
				</view>
			</view>
		</view>
	</view>
</template>


<script>
	import beeApp from '../../beeApp.js'
	export default {
		data() {
			return {
				shopList:[]
			}
		},
		onLoad() {
	
		  this.load();

		},
		onShareAppMessage(res) {
		    if (res.from === 'button') {// 来自页面内分享按钮
		      console.log(res.target)
		    }
		  },
		onPullDownRefresh() {
			this.load();
			uni.stopPullDownRefresh();
		},
		methods: {
			
			// loadStore() {
			// 	var search = beeApp.GetRequest(window.location.search);
			// 	 if(search.title){
			// 		 uni.setNavigationBarTitle({
			// 		 	title:search.title
			// 		 })
			// 	 }
			// },
			contactUs: function(hotline) {
				uni.makePhoneCall({
					phoneNumber: hotline
				});
			},
			
			 
			load: function() {
				
				this.getShopList();
				// this.loadStore();
			},
			
			// 门店列表
		  getShopList: function () {
			var that = this;
			beeApp.api("mall/shop/get", {
				type:'tenement'
			}, function (res) {
			 if(res.code!=200){
				 beeApp.alert(res.msg);
				 return;
			 }
			 var shopList = res.data.list;
			
			  that.shopList = shopList

			})
			 
		},
	  }
	}
</script>


<style>
</style>
